package com.yesallchina.wxapp.officialaccount.api.beans;


import com.yesallchina.wxapp.officialaccount.utils.XmlUtils;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "xml")
public class Message {

    /**
     * 接收方的唯一标识
     */
    private String ToUserName;
    /**
     * 发送方的唯一标识
     */
    private String FromUserName;
    /**
     * 消息创建时间，是一串时间戳数字
     */
    private String CreateTime;
    private String MsgId;
    private String MsgType;

    @XmlElement(name = "ToUserName")
    public String getToUserName() {
        return ToUserName;
    }

    public void setToUserName(String toUserName) {
        ToUserName = toUserName;
    }

    @XmlElement(name = "FromUserName")
    public String getFromUserName() {
        return FromUserName;
    }

    public void setFromUserName(String fromUserName) {
        FromUserName = fromUserName;
    }

    @XmlElement(name = "CreateTime")
    public String getCreateTime() {
        return CreateTime;
    }

    public void setCreateTime(String createTime) {
        CreateTime = createTime;
    }

    @XmlElement(name = "MsgId")
    public String getMsgId() {
        return MsgId;
    }

    public void setMsgId(String msgId) {
        MsgId = msgId;
    }

    @XmlElement(name = "MsgType")
    public String getMsgType() {
        return MsgType;
    }

    public void setMsgType(String msgType) {
        MsgType = msgType;
    }

    /**
     * 转化成被动回复的XML信息
     *
     * @return
     */
    public String toPassiveResponseXML() {
        return XmlUtils.beanToXml(this);
    }

    /**
     * 转换成客服信息
     *
     * @return
     */
    public String toCustomerMessage(){
        return "";
    }

}
